<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<title></title>
		<meta name="description" content="overview & stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href="static/css/bootstrap.min.css" />
		<link rel="stylesheet" href="static/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" href="static/css/font-awesome.min.css" />
		<!-- 下拉框 -->
		<link rel="stylesheet" href="static/css/chosen.css" />
		<link rel="stylesheet" href="static/css/ace.min.css" />
		<link rel="stylesheet" href="static/css/ace-responsive.min.css" />
		<link rel="stylesheet" href="static/css/ace-skins.min.css" />
		<style type="text/css">
		input, textarea, .uneditable-input {
		    width: 306px;
		}
		</style>
		<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
		<!--提示框-->
		<script type="text/javascript" src="static/js/jquery.tips.js"></script>
		<script type="text/javascript">
			$(top.hangge());
			function saveOrganIDCode(){
				if($("#min_code").val()=="" || $("#min_code").val()== null){
					$("#min_code").tips({
						side:3,
			            msg:'输入区间最小值',
			            bg:'#AE81FF',
			            time:3
			        });
					$("#min_code").focus();
					return false;
				}else{
					var min_code = $("#min_code").val();
					
					if(isNaN(min_code)){
						$("#min_code").tips({
							side:3,
				            msg:'区间最小值必须是数值',
				            bg:'#AE81FF',
				            time:3
				        });
						$("#min_code").focus();
						return false;
					}
				}
				
				if($("#max_code").val()==""){
					$("#max_code").tips({
						side:3,
			            msg:'输入区间最大值',
			            bg:'#AE81FF',
			            time:3
			        });
					$("#max_code").focus();
					return false;
				}else{
					var max_code = $("#max_code").val();
					//alert(!isNaN(max_code));
					if(isNaN(max_code)){
						$("#max_code").tips({
							side:3,
				            msg:'区间最大值必须是数值',
				            bg:'#AE81FF',
				            time:3
				        });
						$("#max_code").focus();
						return false;
					}
				}
				
				var myreg = /^(((13[0-9]{1})|15[0-9]{1}|18[0-9]{1}|14[0-9]{1})+\d{8})$/;
				var myreg2 = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
				if($("#phone_number").val()!=""){
					if( !(myreg.test($("#phone_number").val()) || myreg2.test($("#phone_number").val())) ){
						$("#phone_number").tips({
							side:3,
				            msg:'电话号码格式不正确',
				            bg:'#AE81FF',
				            time:3
				        });
						$("#phone_number").focus();
						return false;
					}
				}
				$("#organIDCodeForm").submit();
				$("#centerOfMainFrame").hide();
				$("#centerOfMainFrame2").show();
			}
		</script>
	</head>
<body>
<form action="organ/editOrganIDCode.do" name="organIDCodeForm" id="organIDCodeForm" method="post">
<input type="hidden" name="currentselectorganid" id="currentselectorganid" value="${pageData.currentselectorganid }"/>
<input type="hidden" name="organid" id="organid" value="${pageData.organid }"/>
<div id="centerOfMainFrame">
	<table>
		<tr>
			<td>区间最小值：<input type="text" name="min_code" id="min_code" maxlength="5" value="${resultPageData.min_code }" title="区间最小值"/></td>
		</tr>
		<tr>
			<td>区间最大值：<input type="text" name="max_code" id="max_code" maxlength="5" value="${resultPageData.max_code }" title="区间最大值"/></td>
		</tr>
		<tr>
			<td>联系人名称：<input type="text" name="contact_name" id="contact_name" maxlength="32" value="${resultPageData.contact_name }" title="联系人"/></td>
		</tr>
		<tr>
			<td>联系人电话：<input type="text" name="phone_number" id="phone_number" maxlength="32" value="${resultPageData.phone_number }" title="联系电话"/></td>
		</tr>
		<tr>
			<td>
				备注：<textarea  style="width:90%;height:200px" name="remark" id="remark" >${resultPageData.remark }</textarea>
			</td>
		</tr>
		<tr>
			<td style="text-align: center;">
				<a class="btn btn-mini btn-primary" onclick="saveOrganIDCode();">提交</a>
				<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
			</td>
		</tr>
	</table>
</div>
<input type="hidden" name="token" value="${token}" />
</form>
<div id="centerOfMainFrame2" class="center" style="display:none"><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green"></h4></div>

<!-- 引入 -->
<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
<script type="text/javascript" src="static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="static/js/ace-elements.min.js"></script>
<script type="text/javascript" src="static/js/ace.min.js"></script>
<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
</body>
</html>